home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / dev / lang / Python152_Src.lha / Python152_Source / Amiga / iomode.c < prev    next >
C/C++ Source or Header  |  1994-09-30  |  679b  |  37 lines

  1. RCS_ID_C="$Id: iomode.c,v 4.1 1994/09/29 23:09:02 jraja Exp $";
  2. /*
  3.  *      iomode.c - set file io mode (normal or translated) (SAS/C)
  4.  *
  5.  *      Copyright © 1994 AmiTCP/IP Group, 
  6.  *                       Network Solutions Development Inc.
  7.  *                       All rights reserved.
  8.  */
  9.  
  10. #include <ios1.h>
  11. #include <stdlib.h>
  12.  
  13. int
  14. iomode(int fd, int mode)
  15. {
  16.   struct UFB *ufb;
  17.  
  18.   /*
  19.    * find the ufb *
  20.    */
  21.   if ((ufb = __chkufb(fd)) == NULL) {
  22.     return -1;
  23.   }
  24.   /*
  25.    * Set the translation mode
  26.    *
  27.    * mode == 0 - translate mode on
  28.    * mode == 1 - translate mode off
  29.    */
  30.   if (mode)
  31.     ufb->ufbflg &= ~UFB_XLAT;
  32.   else
  33.     ufb->ufbflg |= UFB_XLAT;
  34.  
  35.   return 0;
  36. }
  37.